package com.nanjia.boot.product.model.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品信息表单对象
 *
 * @author 周洋
 * @since 2025-07-04 15:38
 */
@Getter
@Setter
@Schema(description = "商品信息表单对象")
public class ProductInfoForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品ID")
    private Integer id;

    @Schema(description = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    @Size(max=20, message="商品名称长度不能超过20个字符")
    private String productName;

    @Schema(description = "国条码")
    @Size(max=50, message="国条码长度不能超过50个字符")
    private String barCode;

    @Schema(description = "品牌编码")
    @NotBlank(message = "品牌编码不能为空")
    @Size(max=30, message="品牌编码长度不能超过30个字符")
    private String brandCode;

    @Schema(description = "一级分类ID")
    @NotNull(message = "一级分类ID不能为空")
    private Integer oneCategoryId;

    @Schema(description = "二级分类ID")
    @NotNull(message = "二级分类ID不能为空")
    private Integer twoCategoryId;

    @Schema(description = "三级分类ID")
    @NotNull(message = "三级分类ID不能为空")
    private Integer threeCategoryId;

    @Schema(description = "商品的供应商ID")
    @NotNull(message = "商品的供应商ID不能为空")
    private Integer supplierId;

    @Schema(description = "商品销售价格")
    @NotNull(message = "商品销售价格不能为空")
    private BigDecimal price;

    @Schema(description = "商品加权平均成本")
    @NotNull(message = "商品加权平均成本不能为空")
    private BigDecimal averageCost;

    @Schema(description = "上下架状态：0下架1上架")
    @NotNull(message = "上下架状态：0下架1上架不能为空")
    private Integer publishStatus;

    @Schema(description = "审核状态：0未审核，1已审核")
    @NotNull(message = "审核状态：0未审核，1已审核不能为空")
    private Integer auditStatus;

    @Schema(description = "生产日期")
    @NotNull(message = "生产日期不能为空")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime productionDate;

    @Schema(description = "商品有效期")
    @NotNull(message = "商品有效期不能为空")
    private Integer shelfLife;

    @Schema(description = "商品描述")
    @NotBlank(message = "商品描述不能为空")
    @Size(max=65535, message="商品描述长度不能超过65535个字符")
    private String descript;

    @Schema(description = "商品录入时间")
    @NotNull(message = "商品录入时间不能为空")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime indate;


}
